package me.a01mymap;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class A03_MapDemo3 {
    public static void main(String[] args) {
        //Map集合第二种遍历方式
        Map<String, String> m = new HashMap<>();

        m.put("标枪选手", "马超");
        m.put("人物挂件", "明世隐");
        m.put("御龙骑士", "尹志平");

        //获取所有键值对对象，返回一个Set集合
        Set<Map.Entry<String, String>> entries = m.entrySet();

        //增强for遍历
        for (Map.Entry<String, String> entry : entries) {
            String key = entry.getKey();
            String value = entry.getValue();
            System.out.println(key + " = " + value);
        }
    }
}
